package com.sxpi.user.service.user;

import com.sxpi.user.dto.LoginFaceDto;
import com.sxpi.user.dto.LoginTeDto;
import com.sxpi.user.dto.UserDto;
import com.sxpi.user.feign.api.UserServiceFeign;
import com.sxpi.user.dto.LoginDto;
import com.sxpi.common.result.R;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @Author: 董伟豪
 * @Date: 2022/10/2 17:33
 */
@Service
@Slf4j
public class UserServiceImpl implements IUserService {

    @Autowired
    private UserServiceFeign userServiceFeign;

    /**
     * 用户登录获取openid
     * @param loginVo
     * @return
     */
    @Override
    public R login(LoginDto loginVo){
        return userServiceFeign.login(loginVo);
    }

    /**
     * 更新手机号码更新信息
     * @param loginTeVo
     * @return
     */
    @Override
    public R updateUserTel(LoginTeDto loginTeVo) {
        return userServiceFeign.updateUserTel(loginTeVo);
    }

    /**
     * 人脸识别建档
     * @param loginFaceVo
     * @return
     */
    @Override
    public R createUserFaceModel(LoginFaceDto loginFaceVo) {
        return userServiceFeign.createUserFaceModel(loginFaceVo);
    }

    /**
     * 人脸识别认证，判断是否是同一个人
     * @param loginFaceVo
     * @return
     */
    @Override
    public R verifyUserFaceModel(LoginFaceDto loginFaceVo) {
        return userServiceFeign.verifyUserFaceModel(loginFaceVo);
    }

    /**
     * 修改用户信息
     * @param userDto
     * @return
     */
    @Override
    public R updateUserInfo(UserDto userDto) {
        return userServiceFeign.updateUserModel(userDto);
    }

    /**
     * 根据id查询用户
     * @param userId
     * @return
     */
    @Override
    public R getUserInfo(Long userId) {
        return userServiceFeign.getUserInfo(userId);
    }


}
